package com.cdtye.shuoh.controller.rule;

import com.cdtye.common.webcore.web.AjaxJson;
import com.cdtye.shuoh.domain.rule.vo.RuleConditionsVo;
import com.cdtye.shuoh.service.rule.RuleConditionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 规则条件Controller
 * @author ZhongWang Wang
 * @date 2022-12-21
 */
@RestController
@RequestMapping("/ruleConditions")
public class RuleConditionsController {
    @Autowired
    private RuleConditionsService ruleConditionsService;

    /**
     * 分页查询
     * @param vo
     * @return
     */
    @PostMapping("/pageList")
    public AjaxJson pageList(@RequestBody RuleConditionsVo vo){
        return AjaxJson.success(ruleConditionsService.pageList(vo));
    }

    /**
     * 列表获取
     * @param vo
     * @return
     */
    @PostMapping("/list")
    public AjaxJson list(@RequestBody RuleConditionsVo vo){
        return AjaxJson.success(ruleConditionsService.list(vo));
    }

    /**
     * 根据id删除条件
     * @param id
     * @return
     */
    @GetMapping("/deleteRuleConditionById")
    public AjaxJson deleteRuleConditionById(String id){
        return AjaxJson.success(ruleConditionsService.deleteRuleConditionById(id));
    }

}
